Optimal. Leaf size=170 \[ -\frac {(10 B-7 C) x}{2 a^2}+\frac {4 (3 B-2 C) \sin (c+d x)}{a^2 d}-\frac {(10 B-7 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(10 B-7 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {4 (3 B-2 C) \sin ^3(c+d x)}{3 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.28, antiderivative size = 170, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4157, 4105,
3872, 2713, 2715, 8} \begin {gather*} -\frac {4 (3 B-2 C) \sin ^3(c+d x)}{3 a^2 d}+\frac {4 (3 B-2 C) \sin (c+d x)}{a^2 d}-\frac {(10 B-7 C) \sin (c+d x) \cos (c+d x)}{2 a^2 d}-\frac {(10 B-7 C) \sin (c+d x) \cos ^2(c+d x)}{3 a^2 d (\sec (c+d x)+1)}-\frac {x (10 B-7 C)}{2 a^2}-\frac {(B-C) \sin (c+d x) \cos ^2(c+d x)}{3 d (a \sec (c+d x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 3872
Rule 4105
Rule 4157
Rubi steps
\begin {align*} \int \frac {\cos ^4(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{(a+a \sec (c+d x))^2} \, dx &=\int \frac {\cos ^3(c+d x) (B+C \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx\\ &=-\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \frac {\cos ^3(c+d x) (3 a (2 B-C)-4 a (B-C) \sec (c+d x))}{a+a \sec (c+d x)} \, dx}{3 a^2}\\ &=-\frac {(10 B-7 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \cos ^3(c+d x) \left (12 a^2 (3 B-2 C)-3 a^2 (10 B-7 C) \sec (c+d x)\right ) \, dx}{3 a^4}\\ &=-\frac {(10 B-7 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(10 B-7 C) \int \cos ^2(c+d x) \, dx}{a^2}+\frac {(4 (3 B-2 C)) \int \cos ^3(c+d x) \, dx}{a^2}\\ &=-\frac {(10 B-7 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(10 B-7 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(10 B-7 C) \int 1 \, dx}{2 a^2}-\frac {(4 (3 B-2 C)) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{a^2 d}\\ &=-\frac {(10 B-7 C) x}{2 a^2}+\frac {4 (3 B-2 C) \sin (c+d x)}{a^2 d}-\frac {(10 B-7 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(10 B-7 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {4 (3 B-2 C) \sin ^3(c+d x)}{3 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(369\) vs. \(2(170)=340\).
time = 0.73, size = 369, normalized size = 2.17 \begin {gather*} \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (-36 (10 B-7 C) d x \cos \left (\frac {d x}{2}\right )-36 (10 B-7 C) d x \cos \left (c+\frac {d x}{2}\right )-120 B d x \cos \left (c+\frac {3 d x}{2}\right )+84 C d x \cos \left (c+\frac {3 d x}{2}\right )-120 B d x \cos \left (2 c+\frac {3 d x}{2}\right )+84 C d x \cos \left (2 c+\frac {3 d x}{2}\right )+516 B \sin \left (\frac {d x}{2}\right )-381 C \sin \left (\frac {d x}{2}\right )-156 B \sin \left (c+\frac {d x}{2}\right )+147 C \sin \left (c+\frac {d x}{2}\right )+342 B \sin \left (c+\frac {3 d x}{2}\right )-239 C \sin \left (c+\frac {3 d x}{2}\right )+118 B \sin \left (2 c+\frac {3 d x}{2}\right )-63 C \sin \left (2 c+\frac {3 d x}{2}\right )+30 B \sin \left (2 c+\frac {5 d x}{2}\right )-15 C \sin \left (2 c+\frac {5 d x}{2}\right )+30 B \sin \left (3 c+\frac {5 d x}{2}\right )-15 C \sin \left (3 c+\frac {5 d x}{2}\right )-3 B \sin \left (3 c+\frac {7 d x}{2}\right )+3 C \sin \left (3 c+\frac {7 d x}{2}\right )-3 B \sin \left (4 c+\frac {7 d x}{2}\right )+3 C \sin \left (4 c+\frac {7 d x}{2}\right )+B \sin \left (4 c+\frac {9 d x}{2}\right )+B \sin \left (5 c+\frac {9 d x}{2}\right )\right )}{48 a^2 d (1+\cos (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.73, size = 154, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {-\frac {B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+9 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-7 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {8 \left (\left (-\frac {5 B}{2}+\frac {5 C}{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {10 B}{3}+2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {3 B}{2}+\frac {3 C}{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-2 \left (10 B -7 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(154\) |
default | \(\frac {-\frac {B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+9 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-7 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {8 \left (\left (-\frac {5 B}{2}+\frac {5 C}{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {10 B}{3}+2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {3 B}{2}+\frac {3 C}{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-2 \left (10 B -7 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(154\) |
risch | \(-\frac {5 B x}{a^{2}}+\frac {7 x C}{2 a^{2}}+\frac {i B \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 a^{2} d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} C}{8 a^{2} d}-\frac {15 i B \,{\mathrm e}^{i \left (d x +c \right )}}{8 a^{2} d}+\frac {i {\mathrm e}^{i \left (d x +c \right )} C}{a^{2} d}+\frac {15 i B \,{\mathrm e}^{-i \left (d x +c \right )}}{8 a^{2} d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} C}{a^{2} d}-\frac {i B \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 a^{2} d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} C}{8 a^{2} d}+\frac {2 i \left (15 B \,{\mathrm e}^{2 i \left (d x +c \right )}-12 C \,{\mathrm e}^{2 i \left (d x +c \right )}+27 B \,{\mathrm e}^{i \left (d x +c \right )}-21 C \,{\mathrm e}^{i \left (d x +c \right )}+14 B -11 C \right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}+\frac {B \sin \left (3 d x +3 c \right )}{12 a^{2} d}\) | \(263\) |
norman | \(\frac {\frac {\left (4 B -3 C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {\left (10 B -7 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (10 B -7 C \right ) x}{2 a}-\frac {\left (B -C \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {3 \left (10 B -7 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {\left (10 B -7 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {3 \left (10 B -7 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {\left (10 B -7 C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {5 \left (16 B -11 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}-\frac {\left (21 B -13 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}-\frac {\left (25 B -17 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d}+\frac {2 \left (34 B -23 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}+\frac {\left (139 B -91 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a}\) | \(345\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 372 vs.
\(2 (160) = 320\).
time = 0.49, size = 372, normalized size = 2.19 \begin {gather*} \frac {B {\left (\frac {4 \, {\left (\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {20 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{2} + \frac {3 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} + \frac {\frac {27 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {60 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )} - C {\left (\frac {6 \, {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {42 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.86, size = 157, normalized size = 0.92 \begin {gather*} -\frac {3 \, {\left (10 \, B - 7 \, C\right )} d x \cos \left (d x + c\right )^{2} + 6 \, {\left (10 \, B - 7 \, C\right )} d x \cos \left (d x + c\right ) + 3 \, {\left (10 \, B - 7 \, C\right )} d x - {\left (2 \, B \cos \left (d x + c\right )^{4} - {\left (2 \, B - 3 \, C\right )} \cos \left (d x + c\right )^{3} + 6 \, {\left (2 \, B - C\right )} \cos \left (d x + c\right )^{2} + {\left (66 \, B - 43 \, C\right )} \cos \left (d x + c\right ) + 48 \, B - 32 \, C\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {B \cos ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 192, normalized size = 1.13 \begin {gather*} -\frac {\frac {3 \, {\left (d x + c\right )} {\left (10 \, B - 7 \, C\right )}}{a^{2}} - \frac {2 \, {\left (30 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 40 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 18 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} a^{2}} + \frac {B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 27 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 21 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.90, size = 187, normalized size = 1.10 \begin {gather*} \frac {\left (10\,B-5\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {40\,B}{3}-8\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (6\,B-3\,C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^2\right )}-\frac {x\,\left (10\,B-7\,C\right )}{2\,a^2}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {2\,\left (B-C\right )}{a^2}+\frac {5\,B-3\,C}{2\,a^2}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (B-C\right )}{6\,a^2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________